/*
 * threadtask.h
 *
 *  Created on: 2016年2月24日
 *      Author: Administrator
 */

#ifndef CORE_SOURCES_THREAD_THREAD_POOL_THREAD_TASK_HPP_
#define CORE_SOURCES_THREAD_THREAD_POOL_THREAD_TASK_HPP_
#include <boost/thread/thread.hpp>
#include <boost/asio/detail/config.hpp>
#include "thread_task_base.hpp"
#include "basic/object.hpp"
#include "../conf/def.h"
#include "gc/gc.h"
namespace eyas {
namespace thread {

template<typename F>
class EYAS_THREAD_API thread_task : public thread_task_base{
public:
	thread_task(EYAS_THREAD_RV_REF(F) f)
	:threadfunc_(f){}
	virtual ~thread_task() = default;
private:
	F threadfunc_;
public:
	virtual void on_task();
};

template<typename F>
void thread_task<F>::on_task(){
	this->threadfunc_();
}

}
}
#endif /* CORE_SOURCES_THREAD_THREAD_POOL_THREAD_TASK_HPP_ */
